<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      * {
        margin: 0;
      }
      /* 
        1 repeat
        可以设置row/column的尺寸
        repeat(3, 100px)
        2 minmax
        可以设置一行或者一列的最大最小值范围，从而实现响应式布局
      */
      .main {
        height: 300px;
        width: 300px;
        display: grid;
      }

      .img {
        background-color: rebeccapurple;
        height: 300px;
        grid-area: 1/1/2/2;
      }
      div span {
        grid-area: 1/1/2/2;
        justify-self: end;
        margin: 10px;
      }
      div p {
        /* 修正位置在同一个网格上 */
        grid-area: 1/1/2/2;
        align-self: end;
        justify-self: start;
        background-color: rosybrown;
      }
    </style>
  </head>
  <body>
    <div class="main">
      <div class="img">1</div>
      <span>热卖中</span>
      <p>手机热卖中...</p>
    </div>
  </body>
</html>
